import 'eventable.dart';
import 'sightable.dart';

class Thing extends Sightable {
  String code = '';
  String name = '';
  
  Thing(Map map) : super((map??{})['name']) {
    code = (map??{})['code'];
    id = (map??{})['id'];
  }

  Thing.copy(Thing old) : super(null) {
    name = old.name;
    code = old.code;

    for (var eventable in old.commands) {
      if (eventable is Eventable) {
        add(eventable);
      }
    }
  }

  Thing copy() {
    return Thing.copy(this);
  }
}